/*
 * GeoVISTA Center (Penn State, Dept. of Geography)
 * Copyright (c), 2003-2011,  Jin Chen and Alan M. MacEachren, GeoVISTA Center, Penn State University
 * Licensed under Simplified BSD License
 *
 *
 * @author: jin Chen 
 * @date: Nov 28, 2005$
 * @version: 1.0
 */
package edu.psu.geovista.app.gmatrix.app;

import edu.psu.geovista.app.gmatrix.JDfMatrix;
import edu.psu.geovista.app.gmatrix.component.DendroMatrixHeader;
import edu.psu.geovista.app.gmatrix.component.DfMatrixHeader;
import edu.psu.geovista.app.hce.clustering.model.BCluster;

import javax.swing.*;
import java.util.List;

public class DendroMatrix extends JDfMatrix {

    public DendroMatrix() {
    }

    public DendroMatrix(int rowHeaderWidth, int columnHeaderHight) {
        super(rowHeaderWidth, columnHeaderHight);
    }
    
     protected void setupEvents(){
         super.setupEvents();

     }

     public void setInfo(BCluster rnode, List lfs,List clsts,int nbcls,int nblfcls,double min, double max, String[] leafIds){
          ((DendroMatrixHeader)this.rowheader).setInfo(rnode,lfs,clsts,nbcls,nblfcls,min,max,leafIds);
     }
    protected  void initComponent(int columnHeaderHight, int rowHeaderWidth){

        canvas=getDefaultCanvas();


        JLabel colRd = getDefaultCellRender();

        columnheader=new DfMatrixHeader(columnHeaderHight, SwingConstants.HORIZONTAL );

        columnheader.setCellrender(colRd);


        rowheader=new DendroMatrixHeader( SwingConstants.EAST ); // 

        layout(rowHeaderWidth, columnHeaderHight);


    }

    protected  void layout(int rowHeaderWidth, int columnHeaderHight) {
        super.layout(rowHeaderWidth,columnHeaderHight);

    }

     public void setRownames(String[] rownames) {
        super.setRownames(rownames);
        this.rowheader.setCelllabels(rownames);  

    }
    /*******************************************************************************************************
     *                test
     *******************************************************************************************************/


}
